package com.sk.sourcecircle.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.bumptech.glide.Glide;
import com.jude.rollviewpager.adapter.StaticPagerAdapter;
import com.sk.sourcecircle.R;

import java.util.List;

/**
 * Created by sk on 2018/1/7.
 */

public class PreviewBannerAdapter extends StaticPagerAdapter {

    private List<String> strings;
     private Context context;

    public PreviewBannerAdapter(List<String> strings, Context context) {
        this.strings = strings;
        this.context = context;
    }

    @Override
    public View getView(ViewGroup container, int position) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_preview,container,false);
        com.github.chrisbanes.photoview.PhotoView photoView = view.findViewById(R.id.photo);
        Glide.with(context).load(strings.get(position)).into(photoView);
        return view;
    }

    @Override
    public int getCount() {
        return strings.size();
    }
}
